<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript">
  chrome.extension.onRequest
      .addListener(function(request, sender, sendResponse) {
        switch (request.action) {
        case "ajax":
          $.ajax(request.param).success(function(data) {
            sendResponse({
              result : "success",
              data : data
            });
          }).error(function(jqXHR, textStatus, errorThrown) {
            sendResponse({
              result : "error",
              data : {
                status : jqXHR.status,
                textStatus : textStatus,
                errorThrown : "" + errorThrown
              }
            });
          });
          break;
        default:
          sendResponse({});
        }
      });
</script>
</head>
<body>

</body>
</html>